package net.wofly.sale.stock.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

/**
 * 商品出库
 *
 * @author lign
 * @version 1.0
 * @created 11-10月-2017 21:17:43
 */
@Data
@Entity
@Table(name = "sale_stock_outstock")
@ApiModel(description = "商品出库")
public class OutStock {
    
    @OneToMany(cascade = CascadeType.MERGE, fetch = FetchType.EAGER)
    @JoinColumn(name = "operateStockID")
    @ApiModelProperty(value = "出库详情", required = true)
    public List<InOutStockDetail> inOutStockDetails;
    @Id
    private String outStockID;
    /**
     * 单据照片
     */
    private Long modifyDate;
    /**
     * 出库类型
     */
    @ApiModelProperty(value = "出库类型（订单出库=1；领料单=2；调拨单=3；）", required = true, allowableValues = "1,2,3")
    private Integer outStockType;

    /**
     * 单据照片
     */
    @ApiModelProperty(value = "单据照片")
    private String pic1;
    /**
     * 单据ID
     * <ul>
     * <li>订单ID或领料单ID或调拔单ID</li>
     * </ul>
     */
    @ApiModelProperty(value = "出库单据号", required = true)
    private String proofID;
    @ApiModelProperty(value = "仓库ID", required = true)
    private String warehouseID;

    /**
     * 出库人  仓管员id
     */
    @ApiModelProperty(value = "出库人", required = true)
    private String outStocker;

    /**
     * 出库人名称
     */
    @ApiModelProperty(value = "出库人名称", required = true)
    @Transient
    private String outStockerName;
    /**
     * 出库类型名称
     */
    @ApiModelProperty(value = "出库类型（订单出库=1；领料单=2；调拨单=3；）", required = true, allowableValues = "1,2,3")
    @Transient
    private String outStockTypeStr;
    
    /**
     * 是否客户出库，创建还货订单后台减库存用
     */
    @Transient
    private boolean isCustomerOutStock;

    public OutStock() {
        
    }
    @Override
    public void finalize() throws Throwable {
        
    }
}